<form class="form-horizontal" id="form-add-category">

    {if condition="$info.parent_id gt 0"}
    <div class="form-group">
        <label class="control-label col-xs-2">上级组织</label>
        <div class="col-xs-9">
            <input type="text" readonly class="form-control" value="{$parent.title|default='已删除'}【ID：{$parent.id}】">
        </div>
    </div>
    {else/}
    <div class="form-group">
        <label class="control-label col-xs-2">上级组织</label>
        <div class="col-xs-9">
            <input type="text" readonly class="form-control" value="顶级组织">
        </div>
    </div>
    {/if}


    <div class="form-group">
        <label class="control-label col-xs-2">
            组织名称
            <span style="color: #FF0000;">*</span>
        </label>
        <div class="col-xs-9">
            <input type="text" class="form-control" name="title" placeholder="输入组织名称" value="{$info.title}" required>
        </div>
    </div>

    <div class="form-group">
        <label class="control-label col-xs-2">组织排序</label>
        <div class="col-xs-9">
            <input type="number" class="form-control" name="order" value="{$info.display_order}" placeholder="输入排序序号，序号越高，显示越靠前">
        </div>
    </div>

    <div class="form-group">
        <div class="col-xs-offset-2 col-xs-3">
            <input type="hidden" name="id" value="{$info.id}">
            <button type="submit" class="btn btn-success btn-block">确认编辑</button>
        </div>
    </div>
</form>

<script src="__PUBLIC__/vendors/jquery.validation/jquery.validate.min.js"></script>
<script src="__PUBLIC__/vendors/jquery.validation/additional-methods.js"></script>
<script src="__PUBLIC__/vendors/jquery.validation/messages_zh.min.js"></script>
<script type="application/javascript">
    $(function () {
        $("#form-add-category").validate({
            messages:
                {
                    title: "必须填写组织名称"
                },
            debug: true,
            submitHandler: function () {
                ajaxSubmit('form-add-category', true);
            }
        });
    })
</script>